import request from '@/config/axios'
// import type { TableData } from './types'

export const getVersions = (data: {}): Promise<IResponse> => {
  return request.post({ url: '/admin/lowcode/versions', data })
}

// 配置接口
export const getLowcodeListApi = (params: any): Promise<IResponse> => {
  return request.get({ url: '/admin/lowcode/list', params: params })
}

export const getLowcodeApi = (id: string): Promise<IResponse> => {
  return request.get({ url: '/admin/lowcode/get/' + id })
}

export const saveLowcodeApi = (params: any): Promise<IResponse> => {
  return request.put({ url: '/admin/lowcode', data: params })
}

export const delLowcodeApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.post({ url: '/admin/lowcode', data: ids })
}

// simple-default 模板api
export const getListApi = (url: string, params: any): Promise<IResponse> => {
  return request.get({ url: url, params: params })
}

export const getApi = (url: string, id: string): Promise<IResponse> => {
  return request.get({ url: url + '/' + id })
}

export const saveApi = (url: string, params: any): Promise<IResponse> => {
  return request.put({ url: url, data: params })
}

export const delApi = (url: string, ids: string[] | number[]): Promise<IResponse> => {
  return request.post({ url: url, data: ids })
}
